package cate.game.activity.specall;

import cate.common.table.d.GDFunc;
import cate.game.activity.base.core.Activity;
import cate.game.activity.base.core.ActivityHandler;
import cate.game.util.IntervalCounter;

@Activity(relatedFuncIds = {GDFunc.SPE_CALL})
public class SpeCallHandler extends ActivityHandler<SpeCallSPO, SpeCallActivity> {
    @Override
    public String getName() {
        return "独立卡池召唤";
    }

    @Override
    public SpeCallSPO buildGlobal() {
        return new SpeCallSPO();
    }

    @Override
    public SpeCallActivity buildSingle() {
        return new SpeCallActivity();
    }

    final IntervalCounter c = new IntervalCounter(30);
    @Override
    public void tickSelf() {
        this.getGlobalData().triggerFake(game);
        if (c.trigger()) {
            this.getGlobalData().triggerExe(game);
        }
    }

    @Override
    public void onActOpen() {
        this.getGlobalData().onOpen(game);
    }

    @Override
    public void onActClose() {
        this.getGlobalData().onClose();
    }
}
